package com.uzai.console.web.wxqaddfriend;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.wxqaddfriend.wxqaddfriendtaskaddinfo.WxqAddFriendTaskAddInfoIdDto;
import com.uzai.console.dto.wxqaddfriend.wxqaddfriendtaskaddinfo.WxqAddFriendTaskAddInfoIdListDto;
import com.uzai.console.dto.wxqaddfriend.wxqaddfriendtaskaddinfo.WxqAddFriendTaskAddInfoQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.wxqaddfriend.WxqAddFriendTaskAddInfoService;
import com.uzai.console.vo.wxqaddfriend.wxqaddfriendtaskaddinfo.WxqAddFriendTaskAddInfoVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 清理微信群添加好友明细记录任务
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "微信群添加好友明细记录",tags = "微信群|微信群添加好友明细记录")
@ApiSort(31)
@RestController
public class WxqAddFriendAndInfoController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxqAddFriendAndInfoController.class);

    @Autowired
    private WxqAddFriendTaskAddInfoService wxqAddFriendTaskAddInfoService;

    @ApiOperation(value = "分页查询微信群添加好友添加明细记录列表", notes = "分页查询微信群添加好友添加明细记录列表", response = WxqAddFriendTaskAddInfoVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxqAddFriendTaskAddInfo/findByPage")
    public Object findWxqAddFriendTaskAddInfoPage(@RequestBody WxqAddFriendTaskAddInfoQuery wxqAddFriendTaskAddInfoQuery){
        return wxqAddFriendTaskAddInfoService.findWxqAddFriendTaskAddInfoList(wxqAddFriendTaskAddInfoQuery);
    }

    @ApiOperation(value = "查询微信群添加好友添加明细记录任务详情", notes = "查询微信群添加好友添加明细记录任务详情", response = WxqAddFriendTaskAddInfoVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxqAddFriendTaskAddInfo/findById")
    public Object findWxqAddFriendTaskAddInfo(@RequestBody WxqAddFriendTaskAddInfoIdDto wxqAddFriendTaskAddInfoIdDto){
        return wxqAddFriendTaskAddInfoService.findWxqAddFriendTaskAddInfo(wxqAddFriendTaskAddInfoIdDto);
    }

    @SystemLogType(model = SystemModelEnum.WxqAddFriendTaskAddInfo, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "批量删除微信群添加好友添加明细记录", notes = "批量删除微信群添加好友添加明细记录")
    @ApiOperationSupport(order = 3)
    @PostMapping("/wxqAddFriendTaskAddInfo/batchDelete")
    public Object batchDeleteWxqAddFriendTaskAddInfo(@RequestBody WxqAddFriendTaskAddInfoIdListDto wxqAddFriendTaskAddInfoIdListDto){
        wxqAddFriendTaskAddInfoService.batchDeleteWxqAddFriendTaskAddInfo(wxqAddFriendTaskAddInfoIdListDto);
        return true;
    }

}
